<template>
  <div>
    <h1 ref="myh1">App根组件</h1>
    <hr>
    <button type="button" class="btn btn-primary" @click="getRefs">获取ref引用</button>
    <my-counter ref="CounterRef"></my-counter>
  </div>
</template>

<script>
import MyCounter from './Counter.vue'
export default {
  name: 'MyApp',
  methods: {
    getRefs() {
      //使用ref获取dom元素
      // console.log(this.$refs)
      // this.$refs.myh1.style.color = 'red'
      this.$refs.CounterRef.reset()
    }
  },
  components: {
    MyCounter
  }
}
</script>

<style lang="less" scoped>
</style>